#include "sources/header/picasa_ui.h"

#include <QApplication>
#include <QMap>
#include <iostream>
using namespace std;

int main(int argc, char *argv[])
{
	QApplication app(argc, argv);
	
	QStringList qArgsList( app.arguments() );
	if( !PicasaUI::AreNParameters( qArgsList, 2 ) )
	{
		cout << "Need more parameters" << endl;
		cout << "To get plugin list, add GetLocalPlugins parameter" << endl;
		return app.exec();
	}
	qArgsList.removeAt(0);// remove app name
	QString pluginName = qArgsList.takeAt(0);
	
	if( pluginName == "GetLocalPlugins" )
	{
		cout << "Aviable plugins list:" << endl;
		cout << "picasa" << endl;
		return app.exec();
	}
	if( pluginName == "picasa" )
	{

		cout << "Using Picasa plugin" << endl;
		
		PicasaUI picasaUI( qArgsList );
		return app.exec();
	}
	else
	{
		cout << "Plugin with plugin name: " << pluginName.toStdString() << " not found" << endl;
		cout << "To get plugin list, add GetLocalPlugins parameter" << endl;
		return app.exec();
	}
	//Picasa picaska;
	//picaska.Auth("ivan.shmidt", "killmelater");
	//picaska.
	

	//PicasaUI pIU( app.arguments().mid(2) );
	return app.exec();
}
